package com.TwinBlade.PicturePassword;

import android.app.AlarmManager;
import android.app.KeyguardManager.KeyguardLock;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.PowerManager;
import android.os.SystemClock;
import android.view.KeyEvent;

class a extends BroadcastReceiver
{
  a(AService paramAService)
  {
  }

  public void onReceive(Context paramContext, Intent paramIntent)
  {
    if (paramIntent.getAction().equals("android.intent.action.SCREEN_OFF"))
    {
      AService.a(this.a, SystemClock.uptimeMillis());
      AService.a(this.a, true);
      if (bl.b())
      {
        ak localak = ak.a(AService.a(), false);
        localak.a();
        localak.a = 0;
        localak.setMode(0);
        localak.invalidate();
        if (!AService.a(this.a).getBoolean("EasyWake", true))
          LockActivity.a();
      }
      PowerManager localPowerManager = (PowerManager)this.a.getSystemService("power");
      if ((AService.b(this.a)) || (localPowerManager.isScreenOn()))
        return;
      boolean bool2 = bd.a(paramContext);
      int m = 0;
      if (bool2)
      {
        int n = AService.a(this.a).getInt("LockDelayMinute", 0);
        m = AService.a(this.a).getInt("LockDelaySecond", 0) + n * 60;
      }
      if (m == 0)
      {
        AService.a(this.a, true, "screen off");
        return;
      }
      AService.a(this.a, m);
      return;
    }
    long l;
    int k;
    if (paramIntent.getAction().equals("android.intent.action.SCREEN_ON"))
    {
      l = SystemClock.uptimeMillis() - AService.c(this.a);
      if (!bd.a(paramContext))
        break label1088;
      k = AService.a(this.a).getInt("LockDelayMinute", 0);
    }
    label660: label667: label935: label1088: for (int i = AService.a(this.a).getInt("LockDelaySecond", 0) + k * 60; ; i = 0)
      while (true)
      {
        int j = i * 1000;
        Utilities.a("ElapsedTime: " + Long.toString(l));
        Utilities.a("LockDelay: " + Integer.toString(j));
        AService localAService = this.a;
        boolean bool1;
        String str1;
        label366: String str2;
        if (l > j)
        {
          bool1 = true;
          AService.a(localAService, bool1);
          if (!AService.d(this.a))
            break label660;
          str1 = "WidgetLocker Delayed Lock";
          Utilities.a(str1);
          if ((AService.b(this.a)) && (!AService.e(this.a)) && (!bl.a()))
            AService.a(this.a, true, "screen on widgetlocker");
          if (bl.b())
          {
            if (AService.a(this.a).getBoolean("InfoPanel", false))
            {
              bl localbl = bl.a(AService.a(), false);
              localbl.e();
              localbl.f();
              localbl.a(false);
            }
            if ((!AService.a(this.a).getBoolean("EasyWake", true)) && (!AService.a(this.a).getBoolean("DisplayStockLockscreen", false)))
              LockActivity.b();
          }
          if ((AService.f(this.a) != null) && (AService.g(this.a) != null))
            AService.f(this.a).cancel(AService.g(this.a));
          if ((!bl.a()) && (!AService.h(this.a)) && (!AService.b(this.a)))
          {
            if (!bl.b())
              AService.a(this.a, true, "screen on lock not shown");
            str2 = AService.a(this.a).getString("ForceOrientation", "0");
            if (!str2.equals("0"))
              break label667;
            if (((!AService.i(this.a)) && (AService.j(this.a))) || ((AService.i(this.a)) && (!AService.j(this.a))))
              Utilities.b();
          }
        }
        while (true)
        {
          AService.b(this.a, false);
          return;
          bool1 = false;
          break;
          str1 = "WidgetLocker No Lock";
          break label366;
          if (str2.equals("1"))
          {
            if (AService.j(this.a))
              Utilities.b();
          }
          else if ((str2.equals("2")) && (!AService.j(this.a)))
            Utilities.b();
        }
        if (paramIntent.getAction().equals("com.android.deskclock.ALARM_ALERT"))
        {
          bl.a = true;
          if (!bl.b())
            break;
          bl.a(AService.a(), false).f(false);
          return;
        }
        if (paramIntent.getAction().equals("com.android.deskclock.ALARM_DONE"))
        {
          bl.a = false;
          if (!bl.b())
            break;
          bl.a(AService.a(), false).e(false);
          return;
        }
        if (paramIntent.getAction().equals("android.intent.action.CAMERA_BUTTON"))
        {
          if ((((KeyEvent)paramIntent.getParcelableExtra("android.intent.extra.KEY_EVENT")).getAction() != 0) || (!bl.b()))
            break;
          bl.b = true;
          bl.a(AService.a(), false).f(false);
          return;
        }
        if (paramIntent.getAction().equals("StartLockscreenDelayed"))
        {
          if (AService.k(this.a) != null)
          {
            AService.k(this.a).reenableKeyguard();
            AService.a(this.a, null);
          }
          AService.a(this.a, true, "delayed start");
          return;
        }
        if (paramIntent.getAction().equals("com.teslacoilsw.widgetlocker.intent.LOCKED"))
        {
          if (!AService.b(this.a))
            break;
          if (!bl.b());
        }
        try
        {
          bl.a(AService.a(), false).c();
          AService.c(this.a, true);
          AService.d(this.a, true);
          return;
          if ((!paramIntent.getAction().equals("com.teslacoilsw.widgetlocker.intent.UNLOCKED")) && (!paramIntent.getAction().equals("com.teslacoilsw.widgetlocker.intent.HIDDEN")))
            break;
          Utilities.a("WidgetLocker Unlock/Hide " + AService.b(this.a) + AService.e(this.a) + AService.d(this.a));
          if ((AService.b(this.a)) && (AService.e(this.a)) && ((AService.d(this.a)) || (AService.l(this.a))))
          {
            AService.a(this.a, true, "widgetlocker");
            AService.d(this.a, false);
          }
          AService.c(this.a, false);
          return;
        }
        catch (Exception localException)
        {
          break label935;
        }
      }
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.a
 * JD-Core Version:    0.6.2
 */